//
//  MPAuthMultPartTextRequestParameter.m
//  MPOAuthMobile
//
//  Created by Christopher Anderson on 15/03/2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "MPOAuthMultiPartTextRequestParameter.h"


@implementation MPOAuthMultiPartTextRequestParameter

@synthesize value;

- (id)initWithName:(NSString*)inName andValue:(NSString*)inValue {
	self = [super initWithName:inName];
	if (self) {
		value = inValue;
	}
	return self;
}

- (NSData*) formPostData {
	NSMutableData *formData = [[NSMutableData alloc] init];
	
	NSString *contentDisposition = [NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n", self.name];
	[formData appendData:[contentDisposition dataUsingEncoding:NSUTF8StringEncoding]];
	
	NSString *contentValue = [NSString stringWithFormat:@"%@", self.value];
	[formData appendData:[contentValue dataUsingEncoding:NSUTF8StringEncoding]];
	
	return formData;
}
	

@end
